
/*
* Copyright 2017-2018 pinganfang
* All right reserved.
*
*/
package com.pingan.haofang.searchcloud.metadata.domain;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 
 * @author huhailiang937
 */
@Entity
@Table(name = "t_metadata_field")
@EntityListeners({AuditingEntityListener.class})
public class MetadataField {

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;

    /**
     * 元数据ID
     */
    @Column(name = "meta_id")
    private Long metaId;

    /**
     * 字段名称
     */
    @Column(name = "field_name")
    private String fieldName;

    /**
     * 字段类型ID
     */
    @Column(name = "field_type_id")
    private Integer fieldTypeId;

    /**
     * 字段别名
     */
    @Column(name = "field_comment")
    private String fieldComment;

    /**
     * 是否unique
     */
    @Column(name = "unique_key")
    private Boolean uniqueKey;

    /**
     * 是否版本号
     */
    @Column(name = "version_key")
    private Boolean versionKey;

    /**
     * 是否必填
     */
    @Column(name = "required")
    private Boolean required;

    /**
     * 是否可索引，0：不索引 1:索引
     */
    @Column(name = "indexed")
    private Boolean indexed;

    /**
     * 是否可存储，0：不存储 1:存储
     */
    @Column(name = "is_stored")
    private Boolean stored;

    /**
     * 是否可向量，0：非向量 1:向量
     */
    @Column(name = "term_vectors")
    private Boolean termVectors;

    /**
     * 是否可多值，0：单值 1:多值
     */
    @Column(name = "multi_valued")
    private Boolean multiValued;

    /**
     * 是否Doc Values，0：不是 1：是
     */
    @Column(name = "doc_values")
    private Boolean docValues;

    /**
     * 默认值
     */
    @Column(name = "default_value")
    private String defaultValue;

    /**
     * 复制到字段，多个逗号分隔
     */
    @Column(name = "copy_to_field")
    private String copyToField;

    /**
     * 权重，扩大100倍
     */
    @Column(name = "boost")
    private Long boost;

    /**
     * 创建人
     */
    @Column(name = "create_by")
    @CreatedBy
    private Long createBy;

    /**
     * 最后修改人
     */
    @LastModifiedBy
    @Column(name = "update_by")

    private Long updateBy;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMetaId() {
        return metaId;
    }

    public void setMetaId(Long metaId) {
        this.metaId = metaId;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public Integer getFieldTypeId() {
        return fieldTypeId;
    }

    public void setFieldTypeId(Integer fieldTypeId) {
        this.fieldTypeId = fieldTypeId;
    }

    public String getFieldComment() {
        return fieldComment;
    }

    public void setFieldComment(String fieldComment) {
        this.fieldComment = fieldComment;
    }

    public Boolean getUniqueKey() {
        return uniqueKey;
    }

    public void setUniqueKey(Boolean uniqueKey) {
        this.uniqueKey = uniqueKey;
    }

    public Boolean getRequired() {
        return required;
    }

    public void setRequired(Boolean required) {
        this.required = required;
    }

    public Boolean getIndexed() {
        return indexed;
    }

    public void setIndexed(Boolean indexed) {
        this.indexed = indexed;
    }

    public Boolean getStored() {
        return stored;
    }

    public void setStored(Boolean stored) {
        this.stored = stored;
    }

    public Boolean getTermVectors() {
        return termVectors;
    }

    public void setTermVectors(Boolean termVectors) {
        this.termVectors = termVectors;
    }

    public Boolean getMultiValued() {
        return multiValued;
    }

    public void setMultiValued(Boolean multiValued) {
        this.multiValued = multiValued;
    }

    public Boolean getDocValues() {
        return docValues;
    }

    public void setDocValues(Boolean docValues) {
        this.docValues = docValues;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getCopyToField() {
        return copyToField;
    }

    public void setCopyToField(String copyToField) {
        this.copyToField = copyToField;
    }

    public boolean getVersionKey() {
        return versionKey;
    }

    public void setVersionKey(boolean versionKey) {
        this.versionKey = versionKey;
    }

    public Long getBoost() {
        return boost;
    }

    public void setBoost(Long boost) {
        this.boost = boost;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }
}
